<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Time Formats</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetime.formats.html">Supported Date and Time Formats</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetime.formats.date.html">Date Formats</a></div>
 <div class="up"><a href="datetime.formats.html">Supported Date and Time Formats</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="datetime.formats.time" class="section">
  <h2 class="title">Time Formats</h2>
  
  <p class="para">
   This page describes the different time formats that the
   <span class="function"><a href="function.strtotime.html" class="function">strtotime()</a></span>, <a href="class.datetime.html" class="classname">DateTime</a> and
   <span class="function"><a href="function.date-create.html" class="function">date_create()</a></span> parser understands.
  </p>

  <table class="doctable table">
   <caption><strong>Used Symbols</strong></caption>
   
    <thead>
     <tr>
      <th>Description</th>
      <th>Formats</th>
      <th>Examples</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><em>frac</em></td>
      <td>. [0-9]+</td>
      <td>&quot;.21342&quot;, &quot;.85&quot;</td>
     </tr>

     <tr>
      <td><em>hh</em></td>
      <td>&quot;0&quot;?[1-9] | &quot;1&quot;[0-2]</td>
      <td>&quot;04&quot;, &quot;7&quot;, &quot;12&quot;</td>
     </tr>

     <tr>
      <td><em>HH</em></td>
      <td>[01][0-9] | &quot;2&quot;[0-4]</td>
      <td>&quot;04&quot;, &quot;7&quot;, &quot;19&quot;</td>
     </tr>

     <tr>
      <td><em>meridian</em></td>
      <td>[AaPp] .? [Mm] .? [\0\t ]</td>
      <td>&quot;A.m.&quot;, &quot;pM&quot;, &quot;am.&quot;</td>
     </tr>

     <tr>
      <td><em>MM</em></td>
      <td>[0-5][0-9]</td>
      <td>&quot;00&quot;, &quot;12&quot;, &quot;59&quot;</td>
     </tr>

     <tr>
      <td><em>II</em></td>
      <td>[0-5][0-9]</td>
      <td>&quot;00&quot;, &quot;12&quot;, &quot;59&quot;</td>
     </tr>

     <tr>
      <td><em>space</em></td>
      <td>[ \t]</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><em>tz</em></td>
      <td>&quot;(&quot;? [A-Za-z]{1,6} &quot;)&quot;? | [A-Z][a-z]+([_/][A-Z][a-z]+)+</td>
      <td>&quot;CEST&quot;, &quot;Europe/Amsterdam&quot;, &quot;America/Indiana/Knox&quot;</td>
     </tr>

     <tr>
      <td><em>tzcorrection</em></td>
      <td>&quot;GMT&quot;? [+-] <em>hh</em> &quot;:&quot;? <em>MM</em>?</td>
      <td>&quot;+0400&quot;, &quot;GMT-07:00&quot;, &quot;-07:00&quot;</td>
     </tr>

    </tbody>
   
  </table>


  <table class="doctable table">
   <caption><strong>12 Hour Notation</strong></caption>
   
    <thead>
     <tr>
      <th>Description</th>
      <th>Format</th>
      <th>Examples</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>Hour only, with meridian</td>
      <td><em>hh</em> <em>space</em>? <em>meridian</em></td>
      <td>&quot;4 am&quot;, &quot;5PM&quot;</td>
     </tr>

     <tr>
      <td>Hour and minutes, with meridian</td>
      <td><em>hh</em> [.:] <em>MM</em> <em>space</em>? <em>meridian</em></td>
      <td>&quot;4:08 am&quot;, &quot;7:19P.M.&quot;</td>
     </tr>

     <tr>
      <td>Hour, minutes and seconds, with meridian</td>
      <td><em>hh</em> [.:] <em>MM</em> [.:] <em>II</em> <em>space</em>? <em>meridian</em></td>
      <td>&quot;4:08:37 am&quot;, &quot;7:19:19P.M.&quot;</td>
     </tr>

     <tr>
      <td>MS SQL (Hour, minutes, seconds and fraction with meridian), PHP 5.3 and later only</td>
      <td><em>hh</em> &quot;:&quot; <em>MM</em> &quot;:&quot; <em>II</em> [.:] [0-9]+ <em>meridian</em></td>
      <td>&quot;4:08:39:12313am&quot;</td>
     </tr>

    </tbody>
   
  </table>


  <table class="doctable table">
   <caption><strong>24 Hour Notation</strong></caption>
   
    <thead>
     <tr>
      <th>Description</th>
      <th>Format</th>
      <th>Examples</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>Hour and minutes</td>
      <td>&#039;t&#039;? <em>HH</em> [.:] <em>MM</em></td>
      <td>&quot;04:08&quot;, &quot;19.19&quot;, &quot;T23:43&quot;</td>
     </tr>

     <tr>
      <td>Hour and minutes, no colon</td>
      <td>&#039;t&#039;? <em>HH</em> <em>MM</em></td>
      <td>&quot;0408&quot;, &quot;t1919&quot;, &quot;T2343&quot;</td>
     </tr>

     <tr>
      <td>Hour, minutes and seconds</td>
      <td>&#039;t&#039;? <em>HH</em> [.:] <em>MM</em> [.:] <em>II</em></td>
      <td>&quot;04.08.37&quot;, &quot;t19:19:19&quot;</td>
     </tr>

     <tr>
      <td>Hour, minutes and seconds, no colon</td>
      <td>&#039;t&#039;? <em>HH</em> <em>MM</em> <em>II</em></td>
      <td>&quot;040837&quot;, &quot;T191919&quot;</td>
     </tr>

     <tr>
      <td>Hour, minutes, seconds and timezone</td>
      <td>&#039;t&#039;? <em>HH</em> [.:] <em>MM</em> [.:] <em>II</em> <em>space</em>? ( <em>tzcorrection</em> | <em>tz</em> )</td>
      <td>&quot;040837CEST&quot;, &quot;T191919-0700&quot;</td>
     </tr>

     <tr>
      <td>Hour, minutes, seconds and fraction</td>
      <td>&#039;t&#039;? <em>HH</em> [.:] <em>MM</em> [.:] <em>II</em> <em>frac</em></td>
      <td>&quot;04.08.37.81412&quot;, &quot;19:19:19.532453&quot;</td>
     </tr>

     <tr>
      <td>Time zone information</td>
      <td><em>tz</em> | <em>tzcorrection</em></td>
      <td>&quot;CEST&quot;, &quot;Europe/Amsterdam&quot;, &quot;+0430&quot;, &quot;GMT-06:00&quot;</td>
     </tr>

    </tbody>
   
  </table>

 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetime.formats.html">Supported Date and Time Formats</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetime.formats.date.html">Date Formats</a></div>
 <div class="up"><a href="datetime.formats.html">Supported Date and Time Formats</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
